import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'
import ConfigView from '../views/ConfigView.vue'
import TrainingView from '../views/TrainingView.vue'
import ResultView from '../views/ResultView.vue'

// 定义路由
const routes = [
  {
    path: '/',
    name: 'Home',
    component: HomeView
  },
  {
    path: '/config/:moduleType',
    name: 'Config',
    component: ConfigView,
    props: true
  },
  {
    path: '/training',
    name: 'Training',
    component: TrainingView
  },
  {
    path: '/result',
    name: 'Result',
    component: ResultView
  }
]

// 创建路由实例
const router = createRouter({
  history: createWebHistory(),
  routes
})

export default router